
package com.mc.lp.database.service.handler.util;


import java.util.List;

import org.springframework.util.CollectionUtils;
/**
 * search utility class
 * @author deepak
 *
 */
public class Search {	
	
	public static <I,O> I search(List<I> in,SearchBy<I, O> searchBy, O value){
		if(CollectionUtils.isEmpty(in) || searchBy == null)
			return null;
		else{
			
			for(I i : in){
				 I searched= searchBy.search(i, value);
				 if(searched != null){
					 return searched;
				 }
			}
		}
		return null;
	}
}
